package it.koutifaris.travianmap.ui.viewstate;

import android.os.Parcel;
import android.os.Parcelable;

class XYSquareImpl implements XYSquare {

	private final int x;
	private final int y;

	public XYSquareImpl(int x, int y) {
		this.x = x;
		this.y = y;
	}

	@Override
	public int getX() {
		return x;
	}

	@Override
	public int getY() {
		return y;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel source, int flags) {
		source.writeInt(x);
		source.writeInt(y);
	}

	public final static Parcelable.Creator<XYSquareImpl> CREATOR = new Parcelable.Creator<XYSquareImpl>() {

		@Override
		public XYSquareImpl createFromParcel(Parcel source) {
			int x = source.readInt();
			int y = source.readInt();

			return new XYSquareImpl(x, y);
		}

		@Override
		public XYSquareImpl[] newArray(int size) {
			return new XYSquareImpl[size];
		}

	};

}
